# -*- ecoding: utf-8 -*-
# @ModuleName: buyer_api
# @Author: wangwei 
# @Time: 2023/10/18 11:17
import random

from api.buyer.buyerbaseapi import BuyerBaseApi


class MobileLogin(BuyerBaseApi):

    def __init__(self, phone="18319186054"):
        super().__init__()
        self.url = f"{self.host}/passport/login/{phone}"
        self.params = {
            "sms_code": 908908
        }


class Register(BuyerBaseApi):

    def __init__(self):
        super().__init__()
        self.url = f"{self.host}/passport/register/pc"
        random_num = str(random.randint(10000000, 99999999))
        username=f"es{random_num}"
        phone="183"+random_num

        self.data = {
            "username":username,
            "password": "e10adc3949ba59abbe56e057f20f883e",
            "confirm_password": "123456",
            "mobile": phone,
            "vali_code": "1512",
            "sms_code": "908908"
        }

        


if __name__ == '__main__':
    Register().send()
